package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.*;
import com.sky.entity.OrderDetail;
import com.sky.entity.Orders;
import com.sky.vo.OrderReportVO;
import com.sky.vo.OrderStatisticsVO;
import com.sky.vo.SalesTop10ReportVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description TODO
 * @Author dingchunlin
 * @Date 2023/8/20 16:13
 * @Version 1.0.0
 */
@Mapper
public interface OrderMapper {

    void saveOrder(Orders orders);

    void saveOrderDetail(OrderDetail orderDetail);

    List<OrderDetail> getOrderDetailList(Long orderId);

    List<Orders> getOrderListByStatus(Integer status);

    Page<Orders> orderByPage(OrdersPageQueryDTO ordersPageQueryDTO);

    Orders selectByid(Long orderId);


    @Select("select * from orders where number = #{number}")
    Orders selectByNumber(String number);

    OrderStatisticsVO statistics();

    void updateOrders(Orders orders);

    List<Orders> getOrdersByTime(String time , int status);

    Integer sumAmount(String time , int status);

    Integer validOrderCount(String time , Integer status);

    List<SalesTop10ReportVO> top10(DataOverViewQueryDTO dataOverViewQueryDTO);

    OrderReportVO allOrdersStatistics(String time);

    OrderReportVO OrdersStatistics(DataOverViewQueryDTO dataOverViewQueryDTO);



}
